import { createRouter, createWebHistory } from 'vue-router'
import Books from '@/components/Books.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'books',
      component: Books,
    },
    {
      path: '/detail',
      name: 'detail',
      component: () => import('@/components/Detail.vue'),
    },
    {
      path: '/edit',
      name: 'edit',
      component: () => import('@/components/edit.vue')
    },
    {
      path: '/new',
      name: 'new',
      component: () => import('@/components/NewBook.vue')
    }
  ],
})

export default router
